package com.lipiao.makerandroid.Service;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

public interface UserService {

    //表示提交表单数据，@Field注解键名
    //适用于数据量少的情况
    @POST("User/login")
    @FormUrlEncoded
    Call<ResponseBody> login(@Field("userNumber") String userNumber, @Field("password") String password);

    @FormUrlEncoded
    @POST("User/register")
    Call<ResponseBody> register(@Field("userNumber") String userNumber, @Field("password") String password);

    @FormUrlEncoded
    @POST("User/addRead")
    Call<ResponseBody> addRead(@Field("userNumber") String userNumber, @Field("text") String text);

    @FormUrlEncoded
    @POST("User/getAllCollections")
    Call<ResponseBody> findAllArticle(@Field("userNumber") String userNumber);

    @FormUrlEncoded
    @POST("User/getUserInfo")
    Call<ResponseBody> getUserInfo(@Field("userNumber") String userNumber);

    @FormUrlEncoded
    @POST("User/addCollection")
    Call<ResponseBody> addCollection(@Field("userNumber") String userNumber,@Field("readId")Integer readId);

    @FormUrlEncoded
    @POST("User/deleteCollection")
    Call<ResponseBody> deleteCollection(@Field("userNumber") String userNumber, @Field("readId") Integer readId);

    @FormUrlEncoded
    @POST("User/getTenRead")
    Call<ResponseBody> getTenRead(@Field("userNumber") String userNo);

    @FormUrlEncoded
    @POST("User/updateUserinfo")
    Call<ResponseBody> updateUserinfo(@Field("userNumber") String userNumber,@Field("userName") String userName,@Field("userinfoEmail") String userinfoEmail,@Field("userinfoTel") String userinfoTel,@Field("userinfoGender") String userinfoGender);

    @FormUrlEncoded
    @POST("User/deleteMyRead")
    Call<ResponseBody> deleteMyRead(@Field("userNumber") String userNumber, @Field("readId") Integer readId);

    @FormUrlEncoded
    @POST("User/getReadByUserNumber")
    Call<ResponseBody> getReadByUserNumber(@Field("userNumber") String userNumber);
}
